package com.SMP.service.meet_room;

import com.SMP.dao.MeetSubscribeMapper;
import com.SMP.model.MeetSubscribe;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MeetSubscribeService {

    /**
     * @author SY
     * */
    @Autowired
    MeetSubscribeMapper meetSubscribeMapper;
    /**
     * @param /添加会议预约
     * @author SY
     * */
    public int addMeetSubscribe(MeetSubscribe meetSubscribe ) {

        return meetSubscribeMapper.insert(meetSubscribe);
    }

    /**
     * @param /修改会议预约
     * @author SY
     * */
    public int updManager(MeetSubscribe meetSubscribe) {

        return meetSubscribeMapper.updateByPrimaryKey(meetSubscribe);
    }
    /**
     * @param /查询所有会议预约
     * @author SY
     * */
    public List<MeetSubscribe> selAllMeetSubscribe() {
        List<MeetSubscribe> list=meetSubscribeMapper.selectByExample(null);
        return list;
    }
    /**
     * @param /查询单个会议预约
     * @author SY
     * */
    public MeetSubscribe selMeetSubscribe(String id) {
        MeetSubscribe meetSubscribe=meetSubscribeMapper.selectByPrimaryKey(id);
        return meetSubscribe;
    }
    /**
     * @param /删除单个会议预约
     * @author SY
     * */
    public  int delMeetSubscribe(String id) {
        MeetSubscribe meetSubscribe=meetSubscribeMapper.selectByPrimaryKey(id);
        meetSubscribe.setStandby1("2");
        return meetSubscribeMapper.updateByPrimaryKey(meetSubscribe);
    }
}
